﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace PhysioAssist2Win
{
    /// <summary>
    /// Interaction logic for Aniversarios.xaml
    /// </summary>
    public partial class Aniversarios : Window
    {
        public Aniversarios()
        {
            InitializeComponent();


            //Ajusta posição e tamanho das janelas
            double width = System.Windows.SystemParameters.PrimaryScreenWidth;
            double height = System.Windows.SystemParameters.PrimaryScreenHeight;

            winAniversarios.Width = width;
            winAniversarios.Height = height;

            winAniversarios.Left = 0;
            winAniversarios.Top = 0;



            //Larguras dos Paineis
            pnlEsq.Width = winAniversarios.Width * 0.2;
            pnlEsq.Height = winAniversarios.Height;
            pnlEsq.Margin = new Thickness(20, 20, 0, 0);

            pnlDir.Width = winAniversarios.Width * 0.8;
            pnlDir.Height = winAniversarios.Height;
            pnlDir.Margin = new Thickness(20, 20, 0, 0);




            ListaAniversarios(DateTime.Now.Month);

        }


        private void ListaAniversarios(int mes)
        {
            Label lbl = new Label();
            lbl.Content = "Coleguas do Hospital";
            lbl.FontWeight = FontWeights.Bold;
            lbl.FontSize = 20;
            pnlDir.Children.Add(lbl);


            WS.WSSoapClient client = new WS.WSSoapClient();
            WS.Profissional[] lst = client.ListaAniversariosProfissional(mes);

            foreach (WS.Profissional pro in lst)
            {

                lbl = new Label();

                lbl.Content = pro.nascimento.Day + "/" + pro.nascimento.Month + " - " + pro.nome;
                lbl.FontSize = 40;

                pnlDir.Children.Add(lbl);

            }




            lbl = new Label();
            lbl.Content = "\nPacientes";
            lbl.FontWeight = FontWeights.Bold;
            lbl.FontSize = 20;
            pnlDir.Children.Add(lbl);

            client = new WS.WSSoapClient();
            WS.Paciente[] lst2 = client.ListaAniversariosPaciente(mes);

            foreach (WS.Paciente pac in lst2)
            {

                lbl = new Label();

                lbl.Content = pac.nascimento.Day + "/" + pac.nascimento.Month + " - " + pac.nome;
                lbl.FontSize = 40;

                pnlDir.Children.Add(lbl);

            }

        }



        private void Image_MouseDown_1(object sender, MouseButtonEventArgs e)
        {
            winAniversarios.Close();
        }

        private void pnlEsq_MouseDown(object sender, MouseButtonEventArgs e)
        {
            winAniversarios.Close();
        }


    }
}
